package com.faf.dao;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import com.faf.bean.Detail;
import com.faf.bean.Orders;
import com.faf.dao.OrdersDao.IdType;

public interface OrdersDao extends BaseDao {
	enum IdType {
		UserId, OrderId, StoreId
	}

	public boolean insert(Orders order) throws SQLException;

	public boolean update(Orders order) throws SQLException;

	public ArrayList<String> select() throws SQLException;

	public ArrayList<Orders> select(IdType type, String id) throws SQLException;

	public boolean delete(String orderId) throws SQLException;

	public List<Orders> getOrderListBystoreId(int storeId) throws SQLException;
	
	public int getstoreIdBystoreNumber(String storeNumber) throws SQLException;
	
	public int alterOrdersStateByOrdersId(int ordersId, String way) throws SQLException;
	
	public List<Orders> getProcessedOrdersListBystoreId(int storeId,int startPage, int pageNum) throws SQLException;
	
	public List<Orders> getUntreatedOrdersListBystoreId(int storeId,int startPage, int pageNum) throws SQLException;
	
	public int getPageProcessedOrdersSum(int storeId) throws SQLException;
	
	public int getPageUntreatedOrdersSum(int storeId) throws SQLException;
	
	public ArrayList<Orders> select(IdType type, String id, int currentPage, int pageTotal) throws SQLException;
	
	public int count(IdType type, String id) throws SQLException;

	public List<Orders> getOrderListBystoreIdAndOrdersState(int storeId, int ordersState, String year) throws SQLException;

	public Orders getOrderByOrderNumber(String id) throws SQLException;
	
	public Orders getOrderByOrderId(String id) throws SQLException;

}
